***Experimental Treatments
gen realtrt=.
replace realtrt=1 if OriginalAd==1
replace realtrt=0 if NeutralAd==1
label var realtrt "Whitewashing ad"
tab realtrt

gen neutral=.
replace neutral=1 if NeutralAd==1
replace neutral=0 if OriginalAd==1
label var neutral "Ad with No Racial Cues"
tab neutral

***Demographics
gen white=race
recode white 4=1 5/8=0
tab white

gen Hispanic=ethnic
recode Hispanic 4=0 5/8=1
tab Hispanic

gen nhwhite=.
replace nhwhite=0 if white==0
replace nhwhite=1 if white==1 & Hispanic==0
label var nhwhite "Non-Hispanic White Subject"
tab nhwhite

gen female=gender
recode female 1=0 2=1 3=.
tab female

gen age2=age
replace age2 = "." in 160
replace age2 = "." in 164
replace age2 = "." in 361
label var age2 "Age with Missing or Incomplete Removed"
tab age2

gen college=educ
recode college 1/4=0 5/8=1
label var college "4-year College Degree"
tab college

gen income=inc
recode income 4=0 5=.25 6=.5 7=.75 8=1
tab income

***Racial Attitudes
gen lazyblk2=lazyblks
recode lazyblk2 1=1 2=.83 3=.67 4=.5 5=.33 6=.17 7=0
label var lazyblk2 "Blacks Tend to be Lazy=1"
tab lazyblk2

gen lazywht2=lazywhite
recode lazywht2 1=1 2=.83 3=.67 4=.5 5=.33 6=.17 7=0
label var lazywht2 "Whites Tend to be Lazy=1"
tab lazywht2

gen lazydiff=(lazyblk2 - lazywht2)
label var lazydiff "lazyblk2 - laywht2"
tab lazydiff

***Partisanship
gen party3=party
recode party3 1/3=1 4/6=0 8/9=.5 7=.
label var party3 "3-Cateogry Partisanship, Democrat=1"
tab party3

gen inter1=party3*realtrt
label var inter1 "party3*realtrt"

gen party3_modified=party3
recode party3_modified 1=1 0/.5=0
label var party3_modified "2-Category Partisanship, Ind/GOP=0"
tab party3_modified

***Dependent Variables
gen birther=BOborn
recode birther 4=0 5=.33 6=.67 7=1
label var birther "Obama was born outside the U.S."
tab birther

gen birther_recoded=birther
recode birther_recoded 0=0 .33=1 .67=2 1=3
label var birther_recoded "Birther Coded 0-3"
tab birther_recoded

gen Muslim=BOreligion
recode Muslim 4/5=0 6=1 7/8=0 
label var Muslim "Obama is a Muslim" 
tab Muslim


****Political Behavior Runs

ologit birther_recoded realtrt##c.party3 female age2 college income lazydiff if nhwhite==1 

margins, at((mean) party3=0 realtrt=0) predict(outcome(2))

margins, at((mean) party3=0 realtrt=1) predict(outcome(2))

margins, at((mean) party3=0 realtrt=0) predict(outcome(3))

margins, at((mean) party3=0 realtrt=1) predict(outcome(3))

ologit birther_recoded realtrt##c.party3_modified female age2 college income lazydiff if nhwhite==1 



logit Muslim realtrt##c.party3 female age2 college income lazydiff if nhwhite==1 
margins, at((mean) realtrt=(0(1)1) party3=(0(.5)1))

logit Muslim realtrt##c.party3_modified female age2 college income lazydiff if nhwhite==1 


